<?php
/**
 * User: hjd-yao
 * Date: 2018/11/2
 * Time: 11:10
 */
namespace App\Models;


use App\Helpers\Search;
use App\Helpers\Traits\HandleError;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;

class BaseModel extends Model
{
    use HandleError;

    protected $guarded = [];

    public static function init()
    {
        return new static();
    }

    public static function search(Request $request)
    {
        return Search::make($request)->bindModel(new static());
    }

}